-
-
Notifications
You must be signed in to change notification settings - Fork 886
[EXIF] Support UCS2 and 8-byte encoded string tags #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EXIF] Support UCS2 and 8-byte encoded string tags #1935
Conversation
fdd50c2 to
c1ebf13
Compare
Co-authored-by: Günther Foidl <gue@korporal.at>
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Metadata.cs
Outdated
Show resolved
Hide resolved
|
@JimBobSquarePants Codecov is not working |
Yeah I turned it off for PRs in #1934 because the build/test times were prohibitively expensive. It now runs on a schedule |
tests/ImageSharp.Tests/Metadata/Profiles/Exif/Values/ExifValuesTests.cs
Outdated
Show resolved
Hide resolved
src/ImageSharp/Metadata/Profiles/Exif/ExifEncodedStringHelpers.cs
Outdated
Show resolved
Hide resolved
|
Add new test. The JIS write and read tests pass successfully, but for some reason ExifTool cannot correctly display the JIS encoded text.
|
|
I change JIS encoding, though Test updated with english text. WIndows show correctly, but ExifTool still incorrect. |
| (uint)GetEncoding(encodedString.Code).GetByteCount(encodedString.Text) + CharacterCodeBytesLength; | ||
|
|
||
| public static bool IsEncodedString(ExifTagValue tag) | ||
| public static byte[] GetData(EncodedString encodedString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is used only by the writer yeah? If so I would return an IDisposable containing a pooled buffer which you could use to avoid the buffer allocation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directly writing to output buffer 5d50298
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ace, thanks! I'll review this today.
JimBobSquarePants
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks excellent. Thanks so much for helping out with the fix! 👍
I had a good read of the reference material you provided regard the JIS encoding and the one you have chosen does match the specification. I've unlocked the spec PDF to make this more easily searchable.

Prerequisites
Description
Fixes for #1919
encoded stringtags:UCS2encoded string tags:See: https://www.exiv2.org/tags.html
Todo